package com.adobesamples.state.vo {
  import com.adobesamples.state.model;

  import flash.events.Event;
  import flash.events.EventDispatcher;

  public class ConfigurationItem extends EventDispatcher {

    [Bindable]
    public var design:String = "Shirt1Front";

    [Bindable]
    public var designName:String = "Plain";

    private var _baseColor:Number = 0x666666;

    [Bindable(event="baseColorChanged")]
    public function get baseColor(): Number {
      return _baseColor;
    }

    private var _trimColor:Number = 0xFFFFFF;

    [Bindable(event="trimColorChanged")]
    public function get trimColor(): Number {
      return _trimColor;
    }
    private var _logo:String = "com/adobesamples/view/images/logo/evil_ball.png";

    [Bindable(event="logoChanged")]
    public function get logo(): String {
      return _logo;
    }

    private var _logoName:String = "Evil Ball";

    [Bindable(event="logoChanged")]
    public function get logoName(): String {
      return _logoName;
    }

    private var _name_text:String = "Your Name";

    [Bindable(event="nameTextChanged")]
    public function get name_text(): String {
      return _name_text;
    }

    private var _name_font:String = "Myriad Pro";

    [Bindable(event="nameFontChanged")]
    public function get name_font(): String {
      return _name_font;
    }

    private var _name_font_color:Number = 0x222222;

    [Bindable("nameFontColorChanged")]
    public function get name_font_color(): Number {
      return _name_font_color;
    }

    model function setNameFontColor(color: Number): void {
      _name_font_color = color;
      this.dispatchEvent(new Event("nameFontColorChanged"));
    }

    model function setNameText(text: String): void {
      _name_text = text;
      this.dispatchEvent(new Event("nameTextChanged"));
    }

    model function changeLogo(name: String, image: String): void {
      _logoName = name;
      _logo = image;
      this.dispatchEvent(new Event("logoChanged"));
    }

    model function setTrimColor(color:Number): void {
      _trimColor = color;
      this.dispatchEvent(new Event("trimColorChanged"));

    }

    model function setNameFont(nameFont: String): void {
      _name_font = nameFont;
      this.dispatchEvent(new Event("nameFontChanged"));
    }

    model function setBaseColor(color:Number): void {
      _baseColor = color;
      this.dispatchEvent(new Event("baseColorChanged"));

    }
  }
}